]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appFavorites: Fix nonsense condition
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 29 Jan 2019 21:43:41 +0000 (22:43 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 30 Jan 2019 16:13:16 +0000 (16:13 +0000)
The "in" operator has a lower precedence than negation, so we are
actually testing whether the favorites map contains "false".

Add parentheses to get the intended behavior.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375

js/ui/appFavorites.js

index 0bdf41b22e82d74a2b70ba2c33ff4bfcbc66ca0c..cc3e3c32ae7b13c5ece1be8572da498ef53e7d0f 100644 (file)
@@ -153,7 +153,7 @@ class AppFavorites {
     }
 
     _removeFavorite(appId) {
-        if (!appId in this._favorites)
+        if (!(appId in this._favorites))
             return false;
 
         let ids = this._getIds().filter(id => id != appId);